#pragma once

#include <stdio.h>
#include <string.h>
#include "sqlite3.h"
#include "HY1C_out.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "config.h"
#include "l2_struc.h"

typedef struct
{
	char * key;
	void * value;
}db_item;

int init_db(const char * db_name);
void close_db(void);
int insert_report(l2str *hy1c, l2str *modis, float * wave, size_t nwave);
int insert_gain_report(l2rec_HY1C *hy1c, l2rec_HY1C *modis, float* wave, size_t nwave);
int update_report(db_item *items, const size_t count);
int generate_report(void);

#ifdef __cplusplus
}
#endif
